import yaml
from common.tools import gat_project_path, sep


class GetConf:
    def __init__(self):
        with open(gat_project_path() + sep(["config", "environment.yaml"], True), 'r', encoding='utf-8') as env_file:
            self.env = yaml.load(env_file, Loader=yaml.FullLoader)
            # print(self.env)

    def get_username_password(self):  # 城建账号密码
        chengjian_doct = self.env['ChengJian']
        return chengjian_doct['username'], chengjian_doct['password']


if __name__ == '__main__':
    GetConf()
    # print(GetConf().get_username_password())
